//
//  LHUserInfoManager.m
//  EPA
//
//  Created by 卢浩 on 16/4/25.
//  Copyright © 2016年 卢浩. All rights reserved.
//

#import "LHUserInfoManager.h"
#import "LHMenuViewController.h"

@implementation LHUserInfoManager

+ (instancetype)shareManager{
    static LHUserInfoManager *manager = nil;
    @synchronized (self) {
        if (manager == nil) {
            manager = [[LHUserInfoManager alloc]init];
        }
    }
    return manager;
}

- (void)updateLeftViewUserViewAction{
//    NSLog(@"updateLeftViewUserViewAction");
    [[LHMenuViewController getMenuViewController] setUserViewWithName:self.uname Img:self.icon];
}

- (void)loginWithUserDict:(NSDictionary *)dict{
    if (dict) {
        [self setValuesForKeysWithDictionary:dict];
    }
}

- (void)setValue:(id)value forKey:(NSString *)key{
    [super setValue:value forKey:key];
    //存储到本地
    [[NSUserDefaults standardUserDefaults] setObject:value forKey:key];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

- (NSString *)auth{
    if (_auth == nil) {
        return @"";
    }
    return _auth;
}

@end
